package com.project.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.project.entity.SupplyGoodsEntity;
import com.project.entity.SupplyOrderEntity;
import com.project.service.ISupplierOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("SupplierOrder")
public class SupplierOrderController {

    @Autowired
    private ISupplierOrderService service;

    @RequestMapping("findByItem")
    public IPage<SupplyOrderEntity> findByItem(int pageNO, int status, int pageSize) {

        return service.findByItem(pageNO,status,pageSize);
    }

    @RequestMapping("findById")
    public List<SupplyGoodsEntity> findById(Integer customerId) {

        return service.findById(customerId);
    }

    @RequestMapping("payment")
    public String payment(Integer customerId, int status, String cause) {
        service.payment(customerId,status,cause);
        return "ok";
    }
}
